package com.feng.zhihao.apigeteway.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ModularInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "MODULAR_INFO")

public class ModularInfo implements java.io.Serializable {

	// Fields

	private String modularId;
	private ModularInfo modularInfo;
	private ProjectInfo projectInfo;
	private String modularName;
	private Integer modularState;
	private Set<ChannelInterfaceCase> channelInterfaceCases = new HashSet<ChannelInterfaceCase>(0);
	private Set<InterfaceFieldInfo> interfaceFieldInfos = new HashSet<InterfaceFieldInfo>(0);
	private Set<InterfaceInfo> interfaceInfos = new HashSet<InterfaceInfo>(0);
	private Set<ModularInfo> modularInfos = new HashSet<ModularInfo>(0);
	private Set<ChannelInterface> channelInterfaces = new HashSet<ChannelInterface>(0);

	// Constructors

	/** default constructor */
	public ModularInfo() {
	}

	/** minimal constructor */
	public ModularInfo(String modularId) {
		this.modularId = modularId;
	}

	/** full constructor */
	public ModularInfo(String modularId, ModularInfo modularInfo, ProjectInfo projectInfo, String modularName,
			Integer modularState, Set<ChannelInterfaceCase> channelInterfaceCases,
			Set<InterfaceFieldInfo> interfaceFieldInfos, Set<InterfaceInfo> interfaceInfos,
			Set<ModularInfo> modularInfos, Set<ChannelInterface> channelInterfaces) {
		this.modularId = modularId;
		this.modularInfo = modularInfo;
		this.projectInfo = projectInfo;
		this.modularName = modularName;
		this.modularState = modularState;
		this.channelInterfaceCases = channelInterfaceCases;
		this.interfaceFieldInfos = interfaceFieldInfos;
		this.interfaceInfos = interfaceInfos;
		this.modularInfos = modularInfos;
		this.channelInterfaces = channelInterfaces;
	}

	// Property accessors
	@Id

	@Column(name = "MODULAR_ID", unique = true, nullable = false, length = 36)

	public String getModularId() {
		return this.modularId;
	}

	public void setModularId(String modularId) {
		this.modularId = modularId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARENT_MODULAR_ID")

	public ModularInfo getModularInfo() {
		return this.modularInfo;
	}

	public void setModularInfo(ModularInfo modularInfo) {
		this.modularInfo = modularInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROJECT_ID")

	public ProjectInfo getProjectInfo() {
		return this.projectInfo;
	}

	public void setProjectInfo(ProjectInfo projectInfo) {
		this.projectInfo = projectInfo;
	}

	@Column(name = "MODULAR_NAME", length = 512)

	public String getModularName() {
		return this.modularName;
	}

	public void setModularName(String modularName) {
		this.modularName = modularName;
	}

	@Column(name = "MODULAR_STATE")

	public Integer getModularState() {
		return this.modularState;
	}

	public void setModularState(Integer modularState) {
		this.modularState = modularState;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "modularInfo")

	public Set<ChannelInterfaceCase> getChannelInterfaceCases() {
		return this.channelInterfaceCases;
	}

	public void setChannelInterfaceCases(Set<ChannelInterfaceCase> channelInterfaceCases) {
		this.channelInterfaceCases = channelInterfaceCases;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "modularInfo")

	public Set<InterfaceFieldInfo> getInterfaceFieldInfos() {
		return this.interfaceFieldInfos;
	}

	public void setInterfaceFieldInfos(Set<InterfaceFieldInfo> interfaceFieldInfos) {
		this.interfaceFieldInfos = interfaceFieldInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "modularInfo")

	public Set<InterfaceInfo> getInterfaceInfos() {
		return this.interfaceInfos;
	}

	public void setInterfaceInfos(Set<InterfaceInfo> interfaceInfos) {
		this.interfaceInfos = interfaceInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "modularInfo")

	public Set<ModularInfo> getModularInfos() {
		return this.modularInfos;
	}

	public void setModularInfos(Set<ModularInfo> modularInfos) {
		this.modularInfos = modularInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "modularInfo")

	public Set<ChannelInterface> getChannelInterfaces() {
		return this.channelInterfaces;
	}

	public void setChannelInterfaces(Set<ChannelInterface> channelInterfaces) {
		this.channelInterfaces = channelInterfaces;
	}

}